import Vue from "vue";
import VueRouter from "vue-router";
import Login from "./pages/Login.vue"
import Main from "./pages/Main.vue"
import NotFound from "./pages/NotFound.vue"
Vue.use(VueRouter);
export const router = new VueRouter({
    routes: [
        //path  页面的路径名称  component 当前路由要渲染的组件 redirect 重定向
        { path: "/", redirect: "/login" },
        { path: "/login", component: Login },  
        { path: "/main", component: Main },
        //当上面的所有路由都没有被匹配的时候，会匹配*，从而渲染NotFound组件
        { path: "*", component: NotFound }
    ]

})